<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="start">start</button>
        <button @click="stop">stop</button>
        <h1>{{msg}}</h1>
    </div>
</body>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            msg: '○●●●●●●',
            intervalId: null
        },
        methods: {
            start() {
                var _this = this;
                console.log(_this.msg);
                if(this.intervalId){
                    return;
                }
                this.intervalId = setInterval(function () {
                    var start = _this.msg.substring(0, 1);
                    var end = _this.msg.substring(1, _this.msg.length);
                    _this.msg = end + start;
                }, 400);
            },
            stop() {
                clearInterval(this.intervalId);
                this.intervalId = null;
            }
        }
    });
</script>

</html>